<template>
	<view class="gzh-page">
		<u-navbar class="header" backIconColor="#ffffff"  title="公众号" titleColor="#ffffff"
			:background="{background: 'transparent'}" :is-back="true" z-index="90">
		</u-navbar>
		<image :src="h5MiniAssets('/gzh/bg-1.png')" mode="scaleToFill" class="bg-image"></image>
		<view class="ewm-box" style="margin: auto;border-radius: 24rpx;overflow: hidden;">
			<image @longpress="longpressHandler" :src="gzhPageJumpInfo.gzhQrCode" show-menu-by-longpress mode="widthFix"
				style="width: 100%;  display: block;"></image>
		</view>
	</view>
</template>

<script>
	import {
		gzhPageJumpInfoApi,
		wxEventCountApi
	} from '../../api/config'
	import {
		h5Url,
		h5MiniAssets
	} from '../../configs/env.config'
	export default {
		data() {
			return {
				gzhPageJumpInfo: undefined
			}
		},
		onLoad() {
			this.initConfigData()
			const deviceId = uni.getDeviceInfo().deviceId
			wxEventCountApi({
				userUuid: deviceId,
				type: 2,
			})
		},
		methods: {
			h5MiniAssets,
			async initConfigData() {
				uni.showLoading({
					title: "加载中"
				})
				const res = await gzhPageJumpInfoApi()
				uni.hideLoading()
				this.gzhPageJumpInfo = res.data
			},
			async longpressHandler() {
				const deviceId = uni.getDeviceInfo().deviceId
				wxEventCountApi({
					userUuid: deviceId,
					type: 3,
				})
			}
		}
	}
</script>

<style lang="scss">
.gzh-page{
	position: relative;
	min-height: 100vh;
	.bg-image{
		position: absolute;
		width: 100%;
		height: 100%;
		top: 0;
		left: 0;
		z-index: -1;
	}
}
.ewm-box{
	position: absolute;
	bottom: 13.5%;
	width: 62%;
	left: 19%;
}

	.header {
		background-repeat: no-repeat;
		background-size: 100% auto;
	}
</style>